home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1996 April: Mac OS SDK / Dev.CD Apr 96 SDK / Dev.CD Apr 96 SDK1.toast / Development Kits (Disc 1) / OpenDoc Development Framework / ODFDev / ODF / OS / FWGraphx / Include / FWIconSh.h < prev    next >
Encoding:
C/C++ Source or Header  |  1995-11-08  |  3.0 KB  |  120 lines  |  [TEXT/MPS ]

  1. #ifndef FWICONSH_H
  2. #define FWICONSH_H
  3.  
  4. //========================================================================================
  5. //
  6. //    File:                FWIconSh.h
  7. //    Release Version:    $ 1.0d11 $
  8. //
  9. //    Copyright:    © 1995 by Apple Computer, Inc., all rights reserved.
  10. //
  11. //========================================================================================
  12.  
  13. #ifndef FWBNDSHP_H
  14. #include "FWBndShp.h"
  15. #endif
  16.  
  17. #ifndef FWRECT_H
  18. #include "FWRect.h"
  19. #endif
  20.  
  21. #ifndef FWICON_H
  22. #include "FWIcon.h"
  23. #endif
  24.  
  25. #ifndef FWGCONST_H
  26. #include "FWGConst.h"
  27. #endif
  28.  
  29. #if FW_LIB_EXPORT_PRAGMAS
  30. #pragma lib_export on
  31. #endif
  32.  
  33. //========================================================================================
  34. //    Forward Declarations
  35. //========================================================================================
  36.  
  37. class FW_CLASS_ATTR FW_CGraphicContext;
  38.  
  39. //========================================================================================
  40. //    class FW_CIconShape
  41. //========================================================================================
  42.  
  43. class FW_CLASS_ATTR FW_CIconShape : public FW_CBoundedShape
  44. {
  45. public:
  46.     FW_DECLARE_CLASS
  47.  
  48. //---------------------------------------------------------------------------------------
  49. //    Constructors/Destructors
  50. //
  51. public:
  52.     
  53.     enum
  54.     {
  55.         kDefaultOptions = FW_kIconAlignLeft | FW_kIconAlignTop
  56.     };
  57.  
  58.                             FW_CIconShape(const FW_PIcon& icon,
  59.                                           const FW_CRect& rect,
  60.                                           FW_RenderIconOptions options = kDefaultOptions);
  61.                         
  62.                             FW_CIconShape(const FW_CIconShape& other);
  63.                             FW_CIconShape(FW_CReadableStream& archive);
  64.  
  65.     virtual                    ~FW_CIconShape();
  66.  
  67. //----------------------------------------------------------------------------------------
  68. //    Operators
  69. //
  70. public:
  71.     FW_CIconShape&            operator=(const FW_CIconShape& other);
  72.  
  73. //---------------------------------------------------------------------------------------
  74. //    Inherited API
  75. //
  76. public:
  77.     // ----- Rendering -----
  78.     virtual void            Render(FW_CGraphicContext& gc) const;
  79.  
  80.     // ----- Copying -----
  81.     virtual FW_CShape*        Copy() const;
  82.     
  83.     // ----- Flatten -----
  84.     virtual void            Flatten(FW_CWritableStream& archive) const;
  85.  
  86. //---------------------------------------------------------------------------------------
  87. //    New API
  88. //
  89. public:
  90.     // ----- Rendering -----
  91.     static void                RenderIcon(FW_CGraphicContext& gc,
  92.                                           const FW_PIcon& icon,
  93.                                        const FW_CRect& rect,
  94.                                        FW_RenderIconOptions options = kDefaultOptions);
  95.  
  96.     // ----- Archiving -----
  97.     static void*            Read(FW_CReadableStream& archive);
  98.  
  99.     // ----- Geometry -----
  100.     void                    GetGeometry(FW_PIcon& icon,
  101.                                         FW_RenderIconOptions options,
  102.                                         FW_CRect& bounds) const;
  103.     void                    SetGeometry(const FW_PIcon& icon,
  104.                                         FW_RenderIconOptions options,
  105.                                         const FW_CRect& bounds);
  106.  
  107. //---------------------------------------------------------------------------------------
  108. //    Data Members
  109. //
  110. private:
  111.     FW_PIcon                fIcon;
  112.     FW_RenderIconOptions    fOptions;
  113. };
  114.  
  115. #if FW_LIB_EXPORT_PRAGMAS
  116. #pragma lib_export off
  117. #endif
  118.  
  119. #endif // FWICONSH_H
  120.